class HttpException extends Error {
  constructor(msg = '服务器异常', errorCode = 10000, code = 400) {
    super()
    this.message = msg
    this.errorCode = errorCode
    this.code = code
  }
}

class ParameterException extends HttpException{
  constructor(msg, errorCode){
    super()
    this.code = 400
    this.message = msg || '参数错误'
    this.errorCode = errorCode || 10000
  }
}

module.exports = { HttpException, ParameterException }